#ifndef HUMITEMPCTRLIB_H_
#define HUMITEMPCTRLIB_H_

#include <stdint.h>
#include "temp_box.h"

#ifdef __cplusplus
extern "C"
{
#endif

#define HUMI_AUTO_BACK_MAX 1

	typedef enum
	{
		HT_CTR_MODE_NOCOOL_NOCLR = 0,
		HT_CTR_MODE_COOL = 1,
		HT_CTR_MODE_HUMICLR = 2,
	} ht_ctr_mode_type;

	typedef struct
	{
		lib_ot2_type heat_on;		
		state_req_type cool_on; 
		int32_t heat_out;		
		
		lib_ot2_type humi_on;		  
		state_req_type dehumi_on; 
		int32_t humi_out;		  
	} th_lib_manual_type;

	typedef struct
	{
		int8_t st_humi_ctr_en;		
		int8_t st_keepin_only_heat; 
		int16_t unheat_time;		
		int16_t unheat_temp_offset; 
		int16_t unhumi_time;		
		int16_t unhumi_humi_offset; 
		ht_ctr_mode_type ctr_mode;
		ht_ctr_mode_type ctr_mode_old;
		int16_t temp_offset_at_dehumi;
		int16_t humi_offset_at_cool;
	} th_lib_aux_type;

	typedef struct
	{
		th_lib_manual_type manual;
		th_lib_aux_type aux;
		tlib_cool_cfg_type cool_cfg;
		tlib_cool_state_type cool_st;
		tlib_object_cfg_type temp_cfg;
		tlib_object_state_type temp_st;
		tlib_object_cfg_type humi_cfg;
		tlib_object_state_type humi_st;
		tlib_common_par_type common;
	} ht_ctr_obj_type;

	void ht_box_ctr(ht_ctr_obj_type *CtrPar);

#ifdef __cplusplus
}
#endif

#endif 
